import React from 'react'

const TabbarFunc = (props) => {
    function handleClick(index) {
        props.callback(index);
    }
    return (
        <div>
            <ul>
                {
                    props.list.map((item, index) =>
                        <li key={item.id}
                            className={props.current === index ? 'active' : ''}
                            onClick={() => handleClick(index)}
                        >{item.text}</li>
                    )
                }
            </ul>
        </div>
    )
}

export default TabbarFunc